import request from '@/config/axios'

/** 人力-招聘-岗位信息 */
export interface RecruitPost {
  id: number; // id
  parentId: number; // 父节点
  post?: string; // 岗位
  grade?: number; // 招聘积分
  dept: string; // 部门
  remark: string; // 备注
  children?: RecruitPost[];
}

// 人力-招聘-岗位 API
export const RecruitPostApi = {
  // 查询人力-招聘-岗位列表
  getRecruitPostList: async (params) => {
    return await request.get({url: `/hr/recruit-post/list`, params})
  },

  // 查询人力-招聘-岗位详情
  getRecruitPost: async (id: number) => {
    return await request.get({url: `/hr/recruit-post/get?id=` + id})
  },

  // 新增人力-招聘-岗位
  createRecruitPost: async (data: RecruitPost) => {
    return await request.post({url: `/hr/recruit-post/create`, data})
  },

  // 修改人力-招聘-岗位
  updateRecruitPost: async (data: RecruitPost) => {
    return await request.put({url: `/hr/recruit-post/update`, data})
  },

  // 删除人力-招聘-岗位
  deleteRecruitPost: async (id: number) => {
    return await request.delete({url: `/hr/recruit-post/delete?id=` + id})
  },


  // 导出人力-招聘-岗位 Excel
  exportRecruitPost: async (params) => {
    return await request.download({url: `/hr/recruit-post/export-excel`, params})
  }
}
